import React, {useCallback, useRef, useEffect, memo, useState} from 'react';
import {
  StyleSheet,
  Text,
  View,
  TouchableHighlight,
  FlatList,
} from 'react-native';
import Colors from '../../utils/Colors';
import ProductItem from './ProductItem';

const ProductDe = props => {
  const {list, onLoadMore} = props;
  console.log(88888, list);
  const renderItem = ({item}) => {
    return <ProductItem item={item} />;
  };
  return (
    <View>
      <FlatList
        initialNumToRender={8} // 初始渲染个数
        // style={style.FlatList}
        contentContainerStyle={style.FlatList}
        data={list}
        renderItem={renderItem}
        keyExtractor={item => item.product_id}
        numColumns={2}
      />
    </View>
  );
};
const style = StyleSheet.create({
  FlatList: {
    flexDirection: 'column',
    paddingBottom: 10,
    paddingLeft: '1.2%',
    paddingRight: '1.2%',
    // backgroundColor: '#f40',
  },
  goTop: {
    opacity: 0.8,
    position: 'absolute',
    bottom: 100,
    right: 20,
    width: 40,
    height: 40,
    borderRadius: 50,
    zIndex: 99,
    backgroundColor: Colors.patBGRed,
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
    lineHeight: 40,
    paddingBottom: 5,
  },
});
export default ProductDe;
